<template>
	<Content title="工作台" :autoBack="false" tab tabCurrent="staging">
		<view class="staging">
			<!-- <view class="action-box">
        <u-search
          placeholder="请输入物料编号"
          v-model="search.materialCode"
          :clearabled="true"
          :showAction="false"
          @change="getList(true)"
        ></u-search>
      </view> -->

			<view class="main-box">
				<view class="title">生产管理</view>
				<view class="view-path-box">
					<!-- v-has="'productionBtn'" -->
					<view v-if="$has('productionBtn')" class="path-box-item"
						@click="toPath('/pages/staging/workshop-production/index')">
						<i class="iconfont icon-shengchanguanli-chejianshengchan"></i>
						<p>车间生产</p>
					</view>

					<view v-if="$has('Productionreporting')" class="path-box-item"
						@click="toPath('/pages/staging/production-reporting/index')">
						<i class="iconfont icon-2"></i>
						<p>生产提报</p>
					</view>

					<view v-if="$has('Selfinspectionscrapping')" class="path-box-item"
						@click="toPath('/pages/staging/sel-inspection-scrapping/index')">
						<i class="iconfont icon-shenhe"></i>
						<p>自检报废</p>
					</view>

					<view v-if="$has('Defectiveproducthandling')" class="path-box-item"
						@click="toPath('/pages/staging/handling-defective-products/index')">
						<i class="iconfont icon-shenhe"></i>
						<p>不良品处理</p>
					</view>

					<view v-if="$has('Reworkexecution')" class="path-box-item"
						@click="toPath('/pages/staging/rework-execution/index')">
						<i class="iconfont icon-guzhangbaoxiu"></i>
						<p>返工执行</p>
					</view>

					<view v-if="$has('Clearline')" class="path-box-item"
						@click="toPath('/pages/staging/line-cleaning/index')">
						<i class="iconfont icon-a-3fangwenyichang"></i>
						<p>清线</p>
					</view>

					<view v-if="$has('Abnormalshutdown')" class="path-box-item"
						@click="toPath('/pages/staging/abnormal-shutdown/index')">
						<i class="iconfont icon-gaojingxinxi"></i>
						<p>异常停机</p>
					</view>

					<view v-if="$has('materialshandling')" class="path-box-item"
						@click="toPath('/pages/staging/materials-handling/index')">
						<i class="iconfont icon-baoxiugongdan"></i>
						<p>物料操作</p>
					</view>
					<view v-if="$has('workOrderAdjustment')" class="path-box-item"
						@click="toPath('/pages/staging/work-order-adjustment/index')">
						<i class="iconfont icon-shebeibaoxiu"></i>
						<p>工单调整</p>
					</view>
					<view v-if="$has('transferRecord')" class="path-box-item"
						@click="toPath('/pages/transferRecord/index')">
						<i class="iconfont icon-shebeibaoxiu"></i>
						<p>现场仓调拨</p>
					</view>

					<view v-if="$has('boxItemCodeBinding')" class="path-box-item"
						@click="toPath('/pages/staging/boxItemCodeBinding/index')">
						<i class="iconfont icon-2"></i>
						<p>箱码件码绑定</p>
					</view>
					<!-- <view
            class="path-box-item"
            @click="toPath('/pages/staging/bind-box-code/index')"
          >
            <i class="iconfont icon-gaojingxinxi"></i>
            <p>箱码件码绑定</p>
          </view> -->
					<view class="path-box-item"> </view>
				</view>

				<view class="title">模具管理</view>
				<view class="view-path-box">
					<view v-if="$has('moldServiceApplication')" class="path-box-item"
						@click="toPath('/pages/mold/applyRepair/index?type=add')">
						<i class="iconfont icon-lvlixinxi-"></i>
						<p>维修申请</p>
					</view>
					<view v-if="$has('moldServiceHall')" class="path-box-item"
						@click="toPath('/pages/mold/maintenance-hall/index')">
						<i class="iconfont icon-yinzhang"></i>
						<p>维修大厅</p>
					</view>
					<view v-if="$has('moldMaintainHall')" class="path-box-item"
						@click="toPath('/pages/mold/maintain-hall/index')">
						<i class="iconfont icon-baoxiu"></i>
						<p>保养大厅</p>
					</view>
					<view v-if="$has('moldSpotCheckHall')" class="path-box-item"
						@click="toPath('/pages/mold/inspection-hall/index')">
						<i class="iconfont icon-baoxiu"></i>
						<p>点检大厅</p>
					</view>
					<view v-if="$has('outboundApplication')" class="path-box-item"
						@click="toPath('/pages/mold/inbound-outbound/outbound')">
						<i class="iconfont icon-2"></i>
						<p>出库申请</p>
					</view>
					<view v-if="$has('warehousingApplication')" class="path-box-item"
						@click="toPath('/pages/mold/inbound-outbound/warehousing')">
						<i class="iconfont icon-port"></i>
						<p>入库申请</p>
					</view>
					<view class="path-box-item"> </view>
				</view>

				<view class="title">设备管理</view>
				<view class="view-path-box">
					<view v-if="$has('deviceServiceApplication')" class="path-box-item"
						@click="toPath('/pages/device/maintenance-apply/index')">
						<i class="iconfont icon-lvlixinxi-"></i>
						<p>维修申请</p>
					</view>
					<view v-if="$has('deviceServiceHall')" class="path-box-item"
						@click="toPath('/pages/device/maintenance-hall/index')">
						<i class="iconfont icon-baoxiu"></i>
						<p>维修大厅</p>
					</view>
					<view v-if="$has('deviceMaintenanceHall')" class="path-box-item"
						@click="toPath('/pages/device/maintain-hall/index')">
						<i class="iconfont icon-baoxiu"></i>
						<p>保养大厅</p>
					</view>
					<view v-if="$has('deviceSpotCheck')" class="path-box-item"
						@click="toPath('/pages/device/inspection-hall/index')">
						<i class="iconfont icon-baoxiu"></i>
						<p>点检大厅</p>
					</view>
					<!--           <view
		    class="path-box-item"
		    @click="toPath('/pages/staging/pda-test/index')"
		  >
		    <i class="iconfont icon-baoxiu"></i>
		    <p>pda测试</p>
		  </view> -->
					<view class="path-box-item"> </view>
				</view>
			</view>
		</view>
	</Content>
</template>

<script>
	import Content from "@/components/content/index.vue";
	import fetch from "@/utils/fetch";
	import {
		setMenu
	} from "@/store/user";
	export default {
		components: {
			Content,
		},
		onShow() {
			this.getMenuList()
		},
		data() {
			return {
				search: {
					shipName1: "",
				},
				materialCode: "",
			};
		},
		methods: {
			getMenuList() {
				fetch("get", "/basic/menu/findPermissionByToken")
					.then(
						(res) => {
							setMenu(res.data);
						},
						() => {}
					)
					.catch(() => {});
			},
			toPath(path) {
				uni.navigateTo({
					url: path,
					animationType: "pop-in",
				});
			},
		},
	};
</script>

<style scoped lang="scss">
	.staging {
		display: flex;
		flex-direction: column;
		background-color: #ffffff;
		height: 100%;
		padding-bottom: 20rpx;
	}

	.title {
		font-size: 34rpx;
		margin-bottom: 40rpx;
	}

	.action-box {
		width: 100%;
		padding: 10px 20px;
		box-shadow: 0 12rpx 18rpx -6rpx rgba(0, 0, 0, 0.2);
	}

	.main-box {
		padding: 40rpx 20rpx 20rpx 20rpx;
		flex: 1;
		overflow: auto;

		.view-path-box {
			display: flex;
			flex-wrap: wrap;
			align-items: center;
			justify-content: space-between;

			.path-box-item {
				width: 30%;
				text-align: center;
				margin-bottom: 60rpx;

				i {
					display: block;
					margin-bottom: 20rpx;
					font-size: 38rpx;
				}
			}
		}
	}
</style>